// Created by Joe on 2017/7/13.

// home entry and router
var HOME = [
    generateEntry('用户登录', 0, '#', move(-1, -1, -1, 1), '/profile'),
    generateEntry('社保查询', 1, 'city__home-entry-sbcx', move(-1, 0, 2, 6), '/social-security', 2),
    generateEntry('公积金查询', 2, 'city__home-entry-gjjcx', move(1, 0, 3, 7), '/reserved-fund', 2),
    generateEntry('办事预约', 3, 'city__home-entry-bsyy', move(2, 0, 4, 8), '/affair-appointment', 2),
    generateEntry('驾校指数', 4, 'city__home-entry-jxzs', move(3, 0, 5, 9), '/driving-school', 0),
    generateEntry('资讯', 5, 'city__home-entry-zx', move(4, 0, -1, 14), '/news', 0),
    generateEntry('违章查询', 6, 'city__home-entry-wzcx', move(-1, 1, 7, 10), '/vehicle-violation', 2),
    generateEntry('办事查询', 7, 'city__home-entry-bscx', move(6, 2, 8, 11), '/affair-query', 1),
    generateEntry('办事指南', 8, 'city__home-entry-bszn', move(7, 3, 9, 12), '/affair-guidance', 2),
    generateEntry('热线查询', 9, 'city__home-entry-rxcx', move(8, 4, 14, 13), '/hotline', 0),
    generateEntry('民生公告', 10, 'city__home-entry-msgg', move(-1, 6, 11, -1), '/people-livelihood', 0),
    generateEntry('供暖管家', 11, 'city__home-entry-gngj', move(10, 7, 12, -1), '/heating-steward', 0),
    generateEntry('出入境排队', 12, 'city__home-entry-crjpd', move(11, 8, 13, -1), '/exit-entry', 0),
    generateEntry('气象服务', 13, 'city__home-entry-qxfw', move(12, 9, 14, -1), '/weather', 0),
    generateEntry('二维码', 14, 'city__home-entry-sqcode', move(13, 5, -1, -1), '#')
];

// profile move
var LOGIN = [
    generateMove('快速登录', 'fp', move(-1, -1, 'pp', 'fp-1')),
    generateMove('输入手机号', 'fp-1', move(-1, 'fp', -1, 'fp-2')),
    generateMove('获取验证码', 'fp-2', move(-1, 'fp-1', 'fp-3', 'fp-4')),
    generateMove('输入验证码', 'fp-3', move('fp-2', 'fp-1', -1, 'fp-4')),
    generateMove('立即登录', 'fp-4', move(-1, 'fp-2', -1, 'fp-5')),
    generateMove('新用户注册', 'fp-5', move(-1, 'fp-4', -1, -1)),
    generateMove('密码登录', 'pp', move('fp', -1, -1, 'pp-1')),
    generateMove('输入手机号', 'pp-1', move(-1, 'pp', -1, 'pp-2')),
    generateMove('输入密码', 'pp-2', move(-1, 'pp-1', 'pp-3', 'pp-4')),
    generateMove('忘记密码', 'pp-3', move('pp-2', 'pp-1', -1, 'pp-4')),
    generateMove('立即登录', 'pp-4', move(-1, 'pp-2', -1, 'pp-5')),
    generateMove('新用户注册', 'pp-5', move(-1, 'pp-4', -1, -1))
];
var REGISTER = [
    generateMove('输入手机号', 'up-1', move(-1, -1, -1, 'up-2')),
    generateMove('获取验证码', 'up-2', move(-1, 'up-1', 'up-3', 'up-4')),
    generateMove('输入验证码', 'up-3', move('up-2', 'up-1', -1, 'up-4')),
    generateMove('下一步', 'up-4', move(-1, 'up-2', -1, -1)),
    generateMove('输入密码', 'pp-1', move(-1, -1, -1, 'pp-2')),
    generateMove('提交', 'pp-2', move(-1, 'pp-1', -1, -1))
];
var FIND_PASSWORD = [
    generateMove('输入手机号', 'up-1', move(-1, -1, -1, 'up-2')),
    generateMove('获取验证码', 'up-2', move(-1, 'up-1', 'up-3', 'up-4')),
    generateMove('输入验证码', 'up-3', move('up-2', 'up-1', -1, 'up-4')),
    generateMove('下一步', 'up-4', move(-1, 'up-2', -1, -1)),
    generateMove('输入密码', 'pp-1', move(-1, -1, -1, 'pp-2')),
    generateMove('提交', 'pp-2', move(-1, 'pp-1', -1, -1))
];
var PERSONAL_CENTER = [
    generateMove('实名认证', 'np-1', move(-1, -1, 'np-2', -1)),
    generateMove('修改密码', 'np-2', move('np-1', -1, 'np-3', -1)),
    generateMove('退出登录', 'np-3', move('np-2', -1, -1, -1)),
    generateMove('修改密码', 'cp-1', move(-1, -1, 'cp-2', -1)),
    generateMove('退出登录', 'cp-2', move('cp-1', -1, -1, -1))
];
var CHANGE_PASSWORD = [
    generateMove('原密码', 'pp-1', move(-1, -1, 'pp-2', 'pp-3')),
    generateMove('其它方式修改', 'pp-2', move('pp-1', -1, -1, 'pp-3')),
    generateMove('新密码', 'pp-3', move(-1, 'pp-1', -1, 'pp-4')),
    generateMove('提交', 'pp-4', move(-1, 'pp-3', -1, -1)),
    generateMove('获取验证码', 'fp1-1', move(-1, -1, 'fp1-2', 'fp1-3')),
    generateMove('输入验证码', 'fp1-2', move('fp1-1', -1, -1, 'fp1-3')),
    generateMove('下一步', 'fp1-3', move(-1, 'fp1-1', -1, -1)),
    generateMove('新密码', 'fp2-1', move(-1, -1, -1, 'fp2-2')),
    generateMove('提交', 'fp2-2', move(-1, 'fp2-1', -1, -1))
];
var USER_CERTIFICATION = [
    generateMove('用户名', 'up-1', move(-1, -1, -1, 'up-2')),
    generateMove('身份证号', 'up-2', move(-1, 'up-1', -1, 'up-3')),
    generateMove('提交', 'up-3', move(-1, 'up-2', -1, -1))
];

// weather move
var PREDICTION = [
    generateMove('天气预报', 'wp-link', move(-1, -1, 'wn-link', -1)),
    generateMove('天气预警', 'wn-link', move('wp-link', -1, -1, -1))
];
var WARNING = [
    generateMove('天气预报', 'wp-link', move(-1, -1, 'wn-link', -1)),
    generateMove('天气预警', 'wn-link', move('wp-link', -1, -1, 'ww-1')),
    generateMove('全市预警', 'ww-1', move(-1, 'wn-link', -1, 'ww-2')),
    generateMove('全省预警', 'ww-2', move(-1, 'ww-1', -1, -1))
];

// social-security move
var SOCIAL_HOME = [
    generateMove('养老金', 'ss-h1', move(-1, -1, 'ss-h2', -1)),
    generateMove('医疗', 'ss-h2', move('ss-h1', -1, 'ss-h3', -1)),
    generateMove('退休', 'ss-h3', move('ss-h2', -1, 'ss-h4', -1)),
    generateMove('失业', 'ss-h4', move('ss-h3', -1, -1, -1))
];
var SOCIAL_MEDICAL = [
    generateMove('过滤', 'ss-m1', move(-1, -1, -1, -1))
];
var SOCIAL_MASK = [
    generateMove('起始年', 'ss-mk1', move(-1, -1, 'ss-mk2', 'ss-mk5')),
    generateMove('起始月', 'ss-mk2', move('ss-mk1', -1, 'ss-mk3', 'ss-mk5')),
    generateMove('终止年', 'ss-mk3', move('ss-mk2', -1, 'ss-mk4', 'ss-mk6')),
    generateMove('终止月', 'ss-mk4', move('ss-mk3', -1, -1, 'ss-mk6')),
    generateMove('查询', 'ss-mk5', move(-1, 'ss-mk2', 'ss-mk6', -1)),
    generateMove('取消', 'ss-mk6', move('ss-mk5', 'ss-mk3', -1, -1))
];

// affair-query move
var AFFAIR_HOME = [
    generateMove('过滤', 'aq-h1', move(-1, -1, -1, -1))
];
var AFFAIR_MASK = [
    generateMove('输入手机号', 'aq-mk1', move(-1, -1, -1, 'aq-mk2')),
    generateMove('查询', 'aq-mk2', move(-1, 'aq-mk1', 'aq-mk3', -1)),
    generateMove('取消', 'aq-mk3', move('aq-mk2', 'aq-mk1', -1, -1))
];

// heating-steward move
var HEATING_HOME = [
    generateMove('过滤', 'hs-h1', move(-1, -1, -1, -1))
];
var HEATING_MASK = [
    generateMove('输入区域', 'hs-mk1', move(-1, -1, -1, 'hs-mk2')),
    generateMove('查询', 'hs-mk2', move(-1, 'hs-mk1', 'hs-mk3', 'his-0')),
    generateMove('取消', 'hs-mk3', move('hs-mk2', 'hs-mk1', -1, 'his-0'))
];

// driving-school move
var DRIVING_HOME = [
    generateMove('过滤', 'ds-h1', move(-1, -1, -1, -1))
];
var DRIVING_MASK = [
    generateMove('区域', 'ds-mk1', move(-1, -1, 'ds-mk2', -1)),
    generateMove('通过率', 'ds-mk2', move('ds-mk1', -1, -1, -1))
];

// hotline move
var HOTLINE_HOME = [
    generateMove('过滤', 'hotline-h1', move(-1, -1, -1, -1))
];
var HOTLINE_MASK = [
    generateMove('编号', 'hotline-mk1', move(-1, -1, -1, 'hotline-mk2')),
    generateMove('查询码', 'hotline-mk2', move(-1, 'hotline-mk1', -1, 'hotline-mk3')),
    generateMove('查询', 'hotline-mk3', move(-1, 'hotline-mk2', 'hotline-mk4', -1)),
    generateMove('取消', 'hotline-mk4', move('hotline-mk3', 'hotline-mk2', -1, -1))
];

// people-livelihood move
var PEOPLE_TEMP = [];

// news move
var NEWS_TEMP = [];

// assist function
function generateEntry(name, id, style, move, url, auth) {
    return {
        name: name,
        id: id,
        style: style,
        move: move,
        url: url || '#',
        auth: auth || 0
    };
}

function generateMove(name, id, move) {
    return {
        name: name,
        id: id,
        move: move
    };
}

function move(left, up, right, down) {
    return {
        left: left,
        up: up,
        right: right,
        down: down
    };
}